import {
  eleSupply,
  eleSupplyDetail,
  eleSupplyTimelist,
  mtcakeSettlement,
  mtcakeSettlementDetail,
  mtcakeSettlementTimelist,
  mtcakeSupply,
  mtcakeSupplyDetail,
  mtcakeSupplyTimelist,
  mtflowerSettlement,
  mtflowerSettlementDetail,
  mtflowerSettlementTimelist,
  mtflowerSupply,
  mtflowerSupplyDetail,
  mtflowerSupplyTimelist,
  tkballoonSettlement,
  tkballoonSettlementDetail,
  tkballoonSettlementTimelist,
  tkcakeSettlement,
  tkcakeSettlementDetail,
  tkcakeSettlementTimelist,
  tkflowerSettlement,
  tkflowerSettlementDetail,
  tkflowerSettlementTimelist,
  tkflowerSupply,
  tkflowerSupplyDetail,
  tkflowerSupplyTimelist,
} from "@/apis";
import { CHECK_TYPE_ENUM } from "@/enum/check";

export const CHECK_REQUEST = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ACCOUNT]: mtflowerSettlement,
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: mtflowerSupply,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ACCOUNT]: mtcakeSettlement,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ORDER]: mtcakeSupply,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: tkflowerSettlement,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: tkflowerSupply,
  [CHECK_TYPE_ENUM.DOUYIN_AIRBALL_ACCOUNT]: tkballoonSettlement,
  [CHECK_TYPE_ENUM.DOUYIN_CAKE_ACCOUNT]: tkcakeSettlement,
  [CHECK_TYPE_ENUM.ELE_FLOWER_ORDER]: eleSupply,
};

export const CHECK_DETAIL_REQUEST = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ACCOUNT]: mtflowerSettlementDetail,
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: mtflowerSupplyDetail,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ACCOUNT]: mtcakeSettlementDetail,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ORDER]: mtcakeSupplyDetail,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: tkflowerSettlementDetail,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: tkflowerSupplyDetail,
  [CHECK_TYPE_ENUM.DOUYIN_AIRBALL_ACCOUNT]: tkballoonSettlementDetail,
  [CHECK_TYPE_ENUM.DOUYIN_CAKE_ACCOUNT]: tkcakeSettlementDetail,
  [CHECK_TYPE_ENUM.ELE_FLOWER_ORDER]: eleSupplyDetail,
};

export const CHECK_TIMELIST_REQUEST = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ACCOUNT]: mtflowerSettlementTimelist,
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: mtflowerSupplyTimelist,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ACCOUNT]: mtcakeSettlementTimelist,
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ORDER]: mtcakeSupplyTimelist,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: tkflowerSettlementTimelist,
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: tkflowerSupplyTimelist,
  [CHECK_TYPE_ENUM.DOUYIN_AIRBALL_ACCOUNT]: tkballoonSettlementTimelist,
  [CHECK_TYPE_ENUM.DOUYIN_CAKE_ACCOUNT]: tkcakeSettlementTimelist,
  [CHECK_TYPE_ENUM.ELE_FLOWER_ORDER]: eleSupplyTimelist,
};

export const CHECK_LIST_FIELDS = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ACCOUNT]: [
    "storeName",
    // 'accountPeriod',
    // 'money',
    "receiveMoney",
    "operateReceive",
    "storeReceive",
  ],
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: [
    "storeName",
    "billNum",
    "payAmount",
    "receiveAmount",
  ],
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ORDER]: [],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: [
    "storeName",
    "billNum",
    "storeReceiveAmount",
    "operateReceiveAmount",
  ],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: [
    "verifyStoreName",
    "billNum",
    "payAmount",
    "rebateAmount",
  ],
  [CHECK_TYPE_ENUM.DOUYIN_AIRBALL_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.DOUYIN_CAKE_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.ELE_FLOWER_ORDER]: [],
};

export const CHECK_DETAIL_FIELDS = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ACCOUNT]: [
    "storeName",
    "mobile",
    "storeId",
    "area",
    "operate",
    "operateRate",
    "meituanRate",
    [
      { key: "账期", value: "金额" },
      { key: "accountPeriod", value: "money" },
      { key: "accountPeriod2", value: "money2" },
      { key: "accountPeriod3", value: "money3" },
      { key: "accountPeriod4", value: "money4" },
    ],
    "receiveMoney",
    "operateReceive",
    "storeReceive",
    // "bankOpenName",
    // "bankAccount",
  ],
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.MEITUAN_CAKE_ORDER]: [],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: [
    "storeName",
    "settlementDate",
    "orderNum",
    "orderTime",
    "receiveTotalAmount",
    "plateformFee",
    "receiveAmount",
    "operateRate",
    "operateReceiveAmount",
    "storeReceiveAmount",
  ],
  [CHECK_TYPE_ENUM.DOUYIN_AIRBALL_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.DOUYIN_CAKE_ACCOUNT]: [],
  [CHECK_TYPE_ENUM.ELE_FLOWER_ORDER]: [],
};

export const CHECK_DETAIL_TABLE = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: [
    {
      title: "序号",
      value: "index",
      width: "50",
    },
    {
      title: "补单单号",
      value: "supplyNum",
      width: "100",
    },
    {
      title: "实际支付/金额",
      value: "payAmount",
      sum: true,
    },
    {
      title: "返还金额",
      value: "receiveAmount",
      width: "100",
      sum: true,
    },
  ],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: [
    {
      title: "序号",
      value: "index",
    },
    {
      title: "订单号",
      value: "orderNum",
    },
    {
      title: "运营实收",
      value: "operateReceiveAmount",
      sum: true,
    },
    {
      title: "商家实收",
      value: "storeReceiveAmount",
      sum: true,
    },
    {
      title: "结算时间",
      value: "settlementDate",
    },
    {
      title: "下单时间",
      value: "orderTime",
    },
    {
      title: "收入",
      value: "receiveTotalAmount",
      sum: true,
    },
    {
      title: "平台服务费",
      value: "plateformFee",
      sum: true,
    },
    {
      title: "后台到账金额",
      value: "receiveAmount",
      sum: true,
    },
    {
      title: "运营服务费率",
      value: "operateRate",
    },
  ],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: [
    {
      title: "序号",
      value: "index",
    },
    {
      title: "补单单号",
      value: "orderNum",
    },
    {
      title: "实际支付/金额",
      value: "payAmount",
      sum: true,
    },
    {
      title: "返还金额",
      value: "rebateAmount",
      sum: true,
    },
  ],
};

export const CHECK_FIELDS_MAP = {
  [CHECK_TYPE_ENUM.MEITUAN_FLOWER_ORDER]: [
    {
      title: "返还金额合计",
      value: "receiveAmount",
    },
    {
      title: "实际支付/金额合计",
      value: "payAmount",
    },
  ],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ORDER]: [
    {
      title: "返还金额合计",
      value: "rebateAmount",
    },
    {
      title: "实际支付/金额合计",
      value: "payAmount",
    },
    {
      title: "订单数量",
      value: "billNum",
    },
  ],
  [CHECK_TYPE_ENUM.DOUYIN_FLOWER_ACCOUNT]: [
    {
      title: "商家实收合计",
      value: "storeReceiveAmount",
    },
    {
      title: "运营实收合计",
      value: "operateReceiveAmount",
    },
  ],
};
export const CHECK_FIELDS = [
  {
    title: "核销门店",
    value: "verifyStoreName",
  },
  {
    title: "商户名称",
    value: "storeName",
  },
  {
    title: "订单编号",
    value: "orderNum",
  },
  {
    title: "补单编号",
    value: "supplyNum",
  },
  {
    title: "实际支付/金额",
    value: "payAmount",
  },
  {
    title: "预计收入",
    value: "expectedAmount",
  },
  {
    title: "扣除费用",
    value: "deductionsFee",
  },
  {
    title: "后台到账/实收",
    value: "receiveAmount",
  },
  {
    title: "到账金额(元)",
    value: "receiveMoney",
  },
  {
    title: "手机号码",
    value: "mobile",
  },
  {
    title: "店铺ID",
    value: "storeId",
  },
  {
    title: "订单数量",
    value: "billNum",
  },
  {
    title: "核销门店ID",
    value: "verifyStoreId",
  },
  {
    title: "地区(市+区/县)",
    value: "verifyStoreCity",
  },
  {
    title: "地区(市+区/县)",
    value: "area",
  },
  {
    title: "核销时间",
    value: "verifyTime",
  },
  {
    title: "订单编号",
    value: "orderNum",
  },
  {
    title: "订单类型",
    value: "orderTypes",
  },
  {
    title: "平台服务费",
    value: "plateformFee",
  },
  {
    title: "运营人员",
    value: "operate",
  },
  {
    title: "运营扣点",
    value: "operateDeductions",
  },
  {
    title: "运营实收(元)",
    value: "operateReceive",
    labelKey: "operateCalProcess",
  },
  {
    title: "运营实收(元)",
    value: "operateReceiveAmount",
  },
  {
    title: "商家实收(元)",
    value: "storeReceive",
  },
  {
    title: "商家实收(元)",
    value: "storeReceiveAmount",
  },
  {
    title: "运营费率",
    value: "operateCalProcess",
  },
  {
    title: "运营服务费率",
    value: "operateRate",
  },
  {
    title: "美团费率",
    value: "meituanRate",
  },
  {
    title: "账期",
    value: "accountPeriod",
  },
  {
    title: "金额",
    value: "money",
  },
  {
    title: "后台到账金额",
    value: "receiveAmount",
  },
  {
    title: "收入合计",
    value: "receiveTotalAmount",
  },
  {
    title: "账户性质",
    value: "accountProp",
  },
  {
    title: "提现金额",
    value: "withdrawalMoney",
  },
  {
    title: "银行开户名",
    value: "bankOpenName",
  },
  {
    title: "银行账号",
    value: "bankAccount",
  },
  {
    title: "结算时间",
    value: "settlementDate",
  },
  {
    title: "下单时间",
    value: "orderTime",
  },
];
